www.gusucode.com > VC++ 20个窗体编程实例源码源码程序 > VC++ 20个窗体编程实例源码源码程序/code/1.7 如何使窗口居中显示/Demo/DemoDlg.cpp
//Download by http://www.NewXing.com // DemoDlg.cpp : implementation file // #include "stdafx.h" #include "Demo.h" #include "DemoDlg.h" #ifdef _DEBUG #define new DEBUG_NEW #undef THIS_FILE static char THIS_FILE[] = __FILE__; #endif ///////////////////////////////////////////////////////////////////////////// // CDemoDlg dialog CDemoDlg::CDemoDlg() { } BEGIN_MESSAGE_MAP(CDemoDlg, CDialog) //{{AFX_MSG_MAP(CDemoDlg) ON_BN_CLICKED(IDC_TEST, OnTest) //}}AFX_MSG_MAP END_MESSAGE_MAP() ///////////////////////////////////////////////////////////////////////////// // CDemoDlg message handlers void CDemoDlg::PostNcDestroy() { //删除对话框对象 delete this; } void CDemoDlg::OnTest() { //居中显示窗口 CenterWindow(); }